﻿using System.Web.Mvc;
using System.Web.Mvc.Html;

namespace Presentation.Web.Core.Serialization
{
    public static class SerializationExtensions
    {
        public static MvcHtmlString Serialize(this HtmlHelper helper, string name, object data)
        {
            string codedData = DataContractBinarySerializer.SerializeToString(data);
            return helper.Hidden(name, codedData);
        }
    }
}